﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Security.Cryptography;
using System.IO;

namespace Program
{
    /// <summary>
    /// Interaction logic for wpfJelszoMegadasa.xaml
    /// </summary>
    /// 
    public partial class wpfJelszoMegadasa : Window
    {
        RijndaelManaged Crypto = new RijndaelManaged();

        public wpfJelszoMegadasa()
        {
            InitializeComponent();
        }

        private void btMegse_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

        private void btOk_Click(object sender, RoutedEventArgs e)
        {
            
            if (ellenorzes(Encoding.ASCII.GetBytes(pbJelszo.Password), Crypto.IV))
            {
                this.DialogResult = true;
                this.Close();
            }

            MessageBox.Show("Hibás jelszó!", "Hiba", MessageBoxButton.OK, MessageBoxImage.Error);
        }

        private bool ellenorzes(byte[] Key, byte[] IV)
        {
            return true;
        }
    }
}
